package com.example.demo.service;

import com.example.demo.mapper.UserInfoMapper;
import com.example.demo.model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    public UserInfo selectByName(String username){
        UserInfo userInfo = new UserInfo();
        userInfo = userInfoMapper.selectByName(username);
        if(userInfo==null){
            return null;
        }
        return userInfo;

    }

    public UserInfo selectById(Integer id) {
        System.out.println("1223333");

UserInfo  userInfo = userInfoMapper.selectById(id);
        System.out.println("woddadaaadsss");
        System.out.println("UserService的用户信息为:"+userInfo);
       return userInfoMapper.selectById(id);

    }
}
